-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ui] GraphEditor: create new pipelines with the node menu #1833
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Artificially add a "Pipelines" category in the node menu. The category contains the list of available pipeline templates. Selecting a pipeline instead of a regular node type "creates" the pipeline in the GraphEditor (using the "import project" functionality). The imported pipeline is by default placed under the current graph. This commit does not include enabling the search for pipelines from the "Pipelines" category in the search bar.
A few UI problems to note with the node menu (not directly caused by this PR but extending the menu is highlighting those problems):
|
mugulmd
reviewed
Dec 1, 2022
mugulmd
reviewed
Dec 1, 2022
mugulmd
reviewed
Dec 1, 2022
…de menu If a pipeline is imported with the node menu instead of the "Import Project" action from the File menu, the top-left "corner" of the graph should be placed on the mouse's position. The position of pipelines imported with the "Import Project" menu remains unchanged: they are automatically placed below the lowest node in the current graph.
This property simplifies and optimizes the addition of templates in the node menu and their import into the graph, as it prevents us from looping over the entire "pipelineTemplateFiles" dictionary to retrieve the information we need.
Pipelines can be searched in the list of available node types / pipelines like regular node types.
…he menu This commit is a bugfix. When adding new nodes with the node menu, the selection was never explicitly cleared and nodes were added to the selection rather than being exclusively selected. This behaviour used to be hidden when the node menu could only appear with a right click, as the click would automatically empty the selection. However, with the node menu being now openable with the TAB key, there might not be a click to empty the selection. If new nodes are added by opening the menu with the TAB key and using the arrow keys to select the node to create, an infinite number of them can be created and added to the selection.
Add all the nodes from a pipeline imported through the node menu to the node selection. This involves changing the return value of ImportProjectCommand from a boolean to a list of imported nodes.
cbentejac
force-pushed
the
dev/pipelineInNodeMenu
branch
from
December 2, 2022 17:20
17a94f8
to
6a36da6
Compare
fabiencastan
reviewed
Dec 5, 2022
@@ -363,8 +364,10 @@ def importProject(self, filepath): | |||
localFile = filepath.toString() | |||
else: | |||
localFile = filepath | |||
if isinstance(position, QPoint): | |||
position = Position(position.x(), position.y()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we not import at the center of the GraphEditor when we do not have a mouse position, like for the copy/paste nodes?
fabiencastan
approved these changes
Dec 5, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR adds a "Pipelines" category to the node menu (opened with a right click or a press of the TAB key in the GraphEditor) which contains the list of available templates. Selecting a pipeline through the menu creates said pipeline into the current scene, with its top-left corner being placed on the mouse's position. Pipelines can be searched using the search bar at the same time as any node type.
Features list
Implementation remarks